import { Limit } from '@common/utils/constants';
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsNotEmpty, IsOptional, IsString, ValidateNested } from 'class-validator';
class TestListWhereDto {
    /**
     * id
     */
    @ApiProperty()
    @IsOptional()
    id?: number;
    /**
     * 用户名
     */
    @ApiProperty()
    @IsOptional()
    username?: string;
}

export class TestListDto {
    @ApiProperty()
    @ValidateNested()
    @IsNotEmpty()
    // 这里不加Type不会验证
    @Type(() => TestListWhereDto)
    where: TestListWhereDto;
    @IsOptional()
    @ValidateNested()
    @Type(() => Limit)
    limit?: Limit;
}
